package com.ymttest.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.text.MessageFormat;

/**
 */
public class ObjSerialize {

    public static void main(String[] args) throws Exception {
    }
    
    public static void Serialize(Object o,String path) throws FileNotFoundException,
            IOException {
        ObjectOutputStream oo = new ObjectOutputStream(new FileOutputStream(
                new File(path)));
        oo.writeObject(o);
        oo.close();
    }

    public static Object Deserialize(String path) throws Exception, IOException {
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream(
                new File(path)));
        Object o = ois.readObject();
        return o;
    }

}
